#include <iostream>
#include <memory>
#include <string>
#include <array>

using namespace std;

/*
\ brief:  依赖对象1
\ author: 清晨与猫鱼
*/
class DependentObject1 {
public:

    void setData(string data) {
        data_ = move(data);
    }

    string& getData() {
        return data_;
    }
private:
    string data_;
};


/*
\ brief:  依赖对象2
\ author: 清晨与猫鱼
*/
class DependentObject2 {
public:

    void setData(string data) {
        data_ = move(data);
    }

    string& getData() {
        return data_;
    }
private:
    string data_;
};




/*
\ brief:  粗粒度对象
\ author: 清晨与猫鱼
*/
class CoarseGrainedObject {
public:
    
    void setData(string data1, string data2) {
        do1_.setData(move(data1));
        do2_.setData(move(data2));
    }

    array<string, 2> getData() {
        return array<string, 2>{do1_.getData(), do2_.getData()};
    }
private:
    DependentObject1 do1_;
    DependentObject2 do2_;
};




class CompositeEntity {
public:

    void setData(string data1, string data2) {
        cgo_.setData(move(data1), move(data2));
    }

    array<string, 2> getData() {
        return cgo_.getData();
    }
private:
    CoarseGrainedObject cgo_;
};




class Client {
public:

    void setData(string data1, string data2) {
        compositeEntity_.setData(move(data1), move(data2));
    }


    void printData() {
        array<string, 2> datas = compositeEntity_.getData();
        for (string& str : datas) {
            cout << "Data : " << str << endl;
        }
    }
private:
    CompositeEntity compositeEntity_;
};